package com.daka.vo.response;

import com.daka.entity.Team;
import lombok.Data;
import lombok.ToString;

import java.math.BigDecimal;

/**
 * Created by yangx
 * CreateTime: 2016/12/12 19:44
 */
@Data
@ToString
public class TeamSimpVo {

    /**
     * .
     */
    private Long id;
    /**
     * .名称
     */
    private String name;

    private String leaderPic;

    private String teamPic;

    private Integer Number;

    private BigDecimal totalMoney;

    private int amount;

    public static TeamSimpVo build(Team team) {
        TeamSimpVo teamSimpVo = new TeamSimpVo();
        teamSimpVo.setId(team.getId());
        teamSimpVo.setName(team.getName());
        teamSimpVo.setLeaderPic(team.getLeaderPic());
        teamSimpVo.setTeamPic(team.getTeamPic());
        teamSimpVo.setTotalMoney(team.getTotalMoney().divide(BigDecimal.valueOf(100)));
        return teamSimpVo;
    }

    public static TeamSimpVo build(Team team, Integer number) {
        TeamSimpVo teamSimpVo = new TeamSimpVo();
        teamSimpVo.setId(team.getId());
        teamSimpVo.setName(team.getName());
        teamSimpVo.setLeaderPic(team.getLeaderPic());
        teamSimpVo.setTeamPic(team.getTeamPic());
        teamSimpVo.setTotalMoney(team.getTotalMoney().divide(BigDecimal.valueOf(100)));
        teamSimpVo.setNumber(number);
        return teamSimpVo;
    }

}
